notebook: render a frame and background in the header
authorCosimo Cecchi <cosimoc@gnome.org>
Sat, 5 Mar 2011 08:03:45 +0000 (03:03 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 26 Sep 2013 23:27:54 +0000 (19:27 -0400)
And use the "header" style class to do that.
This allows themes to set e.g. the background of the tab header
differently.

Themes will need slight adjustment to make things appear
as before.

https://bugzilla.gnome.org/show_bug.cgi?id=643914

gtk/gtknotebook.c

index 27880c49f9a3b17fa022fe5a951da059dd690069..f008101475bbb4882fca30d40fb0b2139a40406a 100644 (file)
@@ -5163,6 +5163,14 @@ gtk_notebook_paint (GtkWidget    *widget,
   else
     page = priv->cur_page;
 
+  gtk_style_context_save (context);
+  gtk_style_context_add_class (context, GTK_STYLE_CLASS_HEADER);
+  gtk_render_background (context, cr,
+                         x, y, width, page->allocation.height);
+  gtk_render_frame (context, cr,
+                    x, y, width, page->allocation.height);
+  gtk_style_context_restore (context);
+
   switch (tab_pos)
     {
     case GTK_POS_TOP: